package com.tarena.lbs.marketing.web.rpc;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tarena.lbs.marketing.api.MarketingApi;
import com.tarena.lbs.marketing.web.service.ActivityService;
import com.tarena.lbs.pojo.marketing.po.ActivityPO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@DubboService
@Component
@Slf4j
public class MarketingApiImpl implements MarketingApi {
    @Autowired
    private ActivityService activityService;
    @Override
    public boolean activityIsVisible(Integer userId, Integer activityId) {
        boolean result=false;
        try{
            result=activityService.activityIsVisible(userId,activityId);
        }catch (Exception e){
            log.error("判断是否给用户:{},展示活动id:{},失败",userId,activityId,e);
        }
        return result;
    }

    @Override
    public List<Integer> getActivitiesStores(Integer businessId) {
        List<Integer> result=null;
        try{
            result=activityService.getActivitiesStores(businessId);
        }catch (Exception e){
            log.error("获取商家:{},活动列表失败",businessId,e);
        }
        return result;
    }
}
